package com.yuexun.beilunpatient.ui.activity.ui;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.yuexun.beilunpatient.R;
import com.yuexun.beilunpatient.base.BaseKJActivity;
import com.yuexun.beilunpatient.ui.activity.ui.fragment.Frag_Activity_All;
import com.yuexun.beilunpatient.ui.activity.ui.fragment.Frag_Activity_Apply;
import com.yuexun.beilunpatient.ui.activity.ui.fragment.Frag_Activity_Sign;

import org.kymjs.kjframe.ui.KJFragment;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by chenss on 2018/4/11 0011.
 */

public class Act_Activity_Main extends BaseKJActivity {

    @Bind(R.id.all)
    TextView all;
    @Bind(R.id.all_img)
    ImageView allImg;
    @Bind(R.id.apply)
    TextView apply;
    @Bind(R.id.apply_img)
    ImageView applyImg;
    @Bind(R.id.sign)
    TextView sign;
    @Bind(R.id.sign_img)
    ImageView signImg;

    KJFragment docAll;
    KJFragment docApply;
    KJFragment docSign;

    @Override
    public void setRootView() {
        setContentView(R.layout.act_activity_main);
        ButterKnife.bind(this);
    }

    @Override
    public void initData() {
        docAll = new Frag_Activity_All();
        docApply = new Frag_Activity_Apply();
        docSign = new Frag_Activity_Sign();
        changeFragment(R.id.frg_content, docAll);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }

    @OnClick({R.id.title_back, R.id.all_ll, R.id.apply_ll, R.id.sign_ll})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.title_back:
                finish();
                break;
            case R.id.all_ll:
                all.setTextColor(getResources().getColor(R.color.main_text_02));
                allImg.setBackgroundColor(getResources().getColor(R.color.main_text_02));
                apply.setTextColor(getResources().getColor(R.color.txt_black1));
                applyImg.setBackgroundColor(getResources().getColor(R.color.transparent));
                sign.setTextColor(getResources().getColor(R.color.txt_black1));
                signImg.setBackgroundColor(getResources().getColor(R.color.transparent));
                changeFragment(R.id.frg_content, docAll);
                break;
            case R.id.apply_ll:
                all.setTextColor(getResources().getColor(R.color.txt_black1));
                allImg.setBackgroundColor(getResources().getColor(R.color.transparent));
                apply.setTextColor(getResources().getColor(R.color.main_text_02));
                applyImg.setBackgroundColor(getResources().getColor(R.color.main_text_02));
                sign.setTextColor(getResources().getColor(R.color.txt_black1));
                signImg.setBackgroundColor(getResources().getColor(R.color.transparent));
                changeFragment(R.id.frg_content, docApply);
                break;
            case R.id.sign_ll:
                all.setTextColor(getResources().getColor(R.color.txt_black1));
                allImg.setBackgroundColor(getResources().getColor(R.color.transparent));
                apply.setTextColor(getResources().getColor(R.color.txt_black1));
                applyImg.setBackgroundColor(getResources().getColor(R.color.transparent));
                sign.setTextColor(getResources().getColor(R.color.main_text_02));
                signImg.setBackgroundColor(getResources().getColor(R.color.main_text_02));
                changeFragment(R.id.frg_content, docSign);
                break;
        }
    }
}
